package com.wxxymakers.grademark.model.entity;

import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 
 */
@Data
@TableName(resultMap = "joinAnyMap")
public class WxItemRecord implements Serializable {
    /**
     * 记录的状态 是不是被统计过 统计过就无法修改 没有使用
     */
    private String status;

    @TableId
    private Integer id;

    /**
     * 记录名，一般为自己的项目名，默认和item名相同
     */
    @TableField(condition = SqlCondition.LIKE)
    private String name;

    /**
     * 是否通过审核
     */
    private Boolean audit;

    /**
     * 项目所属用户id
     */
    private Integer userId;
    @TableField(exist = false)
    private WxUser user = new WxUser();

    /**
     * 评定事件id
     */
    private Integer incidentId;
    @TableField(exist = false)
    private WxIncident incident = new WxIncident();

    /**
     * 项目引用id
     */
    private Integer itemId;
    @TableField(exist = false)
    private WxItem item = new WxItem();

    /**
     * 项目级别id
     */
    private String itemRankId;
    @TableField(exist = false)
    private WxItemRank rank = new WxItemRank();

    /**
     * 在项目中担任的地位id
     */
    private String placeId;
    @TableField(exist = false)
    private WxItemPlace place = new WxItemPlace();

    /**
     * 分数 由系统自动计算的
     */
    private Float score;

    /**
     * 立项时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date beginTime;

    /**
     * 结项时间 成果获取时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date datetime;

    /**
     * 记录备注
     */
    private String comment;

    private static final long serialVersionUID = 1L;
}